package com.rescue;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

import com.infomanage.po.AccidentRescue;

public class PhoneRecordService {
  public void savePhoneRecord(AccidentRescue accidentRescue){
	  try {
		SessionFactory sf = new Configuration().configure()
				.buildSessionFactory();
		
		Session session = sf.openSession();
		Transaction tx=session.beginTransaction();
		session.save(accidentRescue);
		tx.commit();//提交事务
		session.close();//关闭Session
	} catch (Exception e) {
		// TODO: handle exception
		e.printStackTrace();
	}
  }
}
